
********************************************************************************


************** Replication codes for "Dictators' facial characteristics and
************** foreign direct investment"



************** This version: August 2022 *************************************





********************************************************************************
********************************************************************************

* Baseline estimates

********************************************************************************
********************************************************************************


*** Use: ReplicationData_updated.dta



***** Retain only leader in office on Dec 31 (transition=0 / transition=2)
drop if transition==1

***** Set data to panel (ccode is the country identifier)
xtset ccode year



*** Baseline estimates (Table 2, p. 23)

** Transition years included

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition~=1, re lag(3)


** Transition years excluded


xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp  trade rents commonlaw i.year if transition==0, re lag(3)






********************************************************************************
********************************************************************************
* Further analysis 

********************************************************************************
********************************************************************************

********************************************************************************



* Interaction of Duration and Competence (Table A3, Appendix D)


** Transition years included
xtscc FDI_cons c.ave_diff_compet_t13##c.duration ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition~=1, re lag(3)

* Transition years excluded
xtscc FDI_cons c.ave_diff_compet_t13##c.duration ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition~=1, re lag(3)








********************************************************************************
********************************************************************************
* Robustness checks
********************************************************************************
********************************************************************************

********************************************************************************



*** Correction of standard errors with 0 to 30 lags (Appendix E, Table A.4)


** Transition years included

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition~=1, re lag(0)

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition~=1, re lag(5)

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition~=1, re lag(10)

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition~=1, re lag(20)

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition~=1, re lag(30)


** Transition years excluded (not displayed in the paper)


xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp  trade rents commonlaw i.year if transition==0, re lag(0)

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp  trade rents commonlaw i.year if transition==0, re lag(5)

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp  trade rents commonlaw i.year if transition==0, re lag(10)

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp  trade rents commonlaw i.year if transition==0, re lag(20)

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp  trade rents commonlaw i.year if transition==0, re lag(30)



********************************************************************************
* Alternative measure of FDI (Table A.5, Appendix E)


** FDI/population, transition years included

xtscc FDI_pop ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
loggdp trade rents commonlaw i.year if transition~=1, re lag(3)

** Log FDI, transition years included

xtscc log_fdi ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
loggdp trade rents commonlaw i.year if transition~=1, re lag(3)

** FDI/population, without transition years

xtscc FDI_pop ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
loggdp trade rents commonlaw i.year if transition==0, re lag(3)

** Log FDI, without transition years

xtscc log_fdi ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
loggdp trade rents commonlaw i.year if transition==0, re lag(3)




*******************************************************************************
* Alternative measures of of competence and trustworthiness (1) = raw scores

* Appendix E, Table A6

** Transition years included

xtscc FDI_cons ave_compet_t13 ave_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition~=1, re lag(3)

** Transition years excluded

xtscc FDI_cons ave_compet_t13 ave_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition==0, re lag(3)




  
********************************************************************************
* Alternative measurement of competence and trustworthiness (2) = restrictive measure

* Appendix E, Table A7

** Transition years included

xtscc FDI_cons ave_diff_compet_t123 ave_diff_trust_t123 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition~=1, re lag(3)

** Transition years excluded

xtscc FDI_cons ave_diff_compet_t123 ave_diff_trust_t123 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition==0, re lag(3)




  
********************************************************************************
* Additional facial and picture characteristics

** Table A.8, Appendix E


** Transition years included

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13   ///
ave_diff_attrac_t13 ave_diff_matur_t13 ave_diff_mascul_t13 smiling bald facialhair ///
gazedirection glasses i.tilted ageleader duration i.ethnicity heredit elected irregular  ///
gdp trade rents commonlaw i.year if transition~=1, re lag(3)

** Transition years excluded

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13   ///
ave_diff_attrac_t13 ave_diff_matur_t13 ave_diff_mascul_t13 smiling bald facialhair ///
gazedirection glasses i.tilted ageleader duration i.ethnicity heredit elected irregular  ///
gdp trade rents commonlaw i.year if transition==0, re lag(3)




********************************************************************************
* Correlated random effects

** Table A9 (appendix E)

* Get cluster mean of country-level time-varying predictors
sort ccode year transition
by ccode: egen m_gdp = mean(gdp)
by ccode: egen m_rents = mean(rent)
by ccode: egen m_trade = mean(trade)


xi : xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year m_* if transition~=1, re lag(3)
  
xi : xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular  ///
gdp trade rents commonlaw i.year m_* if transition==0, re lag(3)





********************************************************************************
* Sample restriction = window of 15 years around the picture date
* Inclusion condition: window = 0

** Table A10, Appendix E



***** with transition years

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition~=1 & window==0, re lag(3)

  
**** w/o transition years
  
xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular  ///
  gdp trade rents commonlaw i.year if transition==0 & window==0, re lag(3)
  
  
 
 
********************************************************************************
* Drop elected leaders

** Table A11, Appendix E



** transition years included

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition~=1 & elected==0, re lag (3)
 

 ** transition years excluded

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition==0 & elected==0, re lag (3)





*******************************************************************************
* Subsamples defined according to leaders' entry mode

** Table A12, Appendix E

*1/ Subsample 1 (top of the table): hereditary succession or irregular entry

xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition~=1 & (irregular==1 | hereditary==1), re lag(3)


xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular  ///
 gdp trade rents commonlaw i.year if transition==0 & (irregular==1 | hereditary==1), re lag(3)
  

*2/ Subsample 2 (bottom of the table): elected or appointed leaders


xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition~=1 & elected==1 | (hereditary==0 & irregular==0), re lag(3)
  
xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular      ///
gdp trade rents commonlaw i.year if transition==0 & elected==1 | (hereditary==0 & irregular==0), re lag(3)




********************************************************************************

*** Heckman selection model

** Table A.13, Appendix E

xi : heckman FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected      ///
gdp trade rents commonlaw i.year if transition~=1, ///
select(irregular = campaign war expend)  two


xi : heckman FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration i.ethnicity heredit elected irregular  ///
gdp trade rents commonlaw i.year if transition==0, ///
select(irregular = campaign war expend)  two






********************************************************************************

*** Multiple imputation

** Table A14, Appendix E

* Declare as MI dataset
mi set wide 
 mi xtset, clear

 * Drop observations for which all economic variables are missing
 drop if gdp==. & FDI_const==. & rents==. & trade==. 

 * Register variables
mi register regular ccode ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling ///
 gazedirection glasses ageleader duration ethnicity heredit elected irregular transition ///
 communist
mi register imputed FDI_cons gdp rents trade population

* Imputation  
 mi impute chained (regress) FDI_constant gdp rents population trade  ///
 = year i.ccode communist  ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling ///
 gazedirection glasses ageleader duration ethnicity hereditary elected irregular, add(20)  rseed(2804) 

* Analysis // with transition years
mi xtset ccode year 

tab year, gen(yr_)
tab ethnicity, gen(ethnicity_cat)

mi estimate, cmdok : xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration ethnicity_cat1 ethnicity_cat2 heredit elected irregular      ///
gdp trade rents  yr_* ,  fe lag(3)


* Without transition years
mi estimate, cmdok : xtscc FDI_cons ave_diff_compet_t13 ave_diff_trust_t13 ave_qual_t13 smiling  ///
gazedirection glasses ageleader duration ethnicity_cat1 ethnicity_cat2 heredit elected irregular      ///
gdp trade rents  yr_* if transition==0,  fe lag(3)




